/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package cz.muni.fi.pa165.carpark.rest.util;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

/**
 *
 * @author Martin
 */
@Component
public class PropertyHelper {
       
    @Value("${rest.employeeservice}")
    private String employeeRestService;
    
    @Value("${rest.servicecheck}")
    private String serviceCheckRestService;
    
    @Value("${rest.businesstrip}")
    private String businessTripRestService;
    
    @Value("${rest.vehicle}")
    private String vehicleRestService;
    
    @Value("${rest.host}") 
    private String host;
    
    @Value("${rest.port}")
    private int port;    
    
    @Value("${rest.webapp}")
    private String webapp;
    
    @Value("${rest.login}")
    private String login;
    
    @Value("${rest.password}")
    private String password;
    
    public String getEmployeeRestServiceURL() {
        return "http://" + host + ":" + port + "/" + webapp + "/" + employeeRestService;
    }
    public String getServiceCheckURL() {
        return "http://" + host + ":" + port + "/" + webapp + "/" + serviceCheckRestService;
    }
    public String getBusinessTripURL() {
        return "http://" + host + ":" + port + "/" + webapp + "/" + businessTripRestService;
    }
    public String getVehicleURL() {
        return "http://" + host + ":" + port + "/" + webapp + "/" + vehicleRestService;
    }
    
    public String getToken() {
        return "?token=" + login + ":" + password;
    }

}
